From: Georges Basile Stavracas Neto Date: Tue, 26 May 2020 13:58:56 +0000 (-0300) Subject: appDisplay: Introduce moveItem API X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~123 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1e31caf0b882627a0eafa2903dc4ce931c98f0ce;p=gnome-shell.git appDisplay: Introduce moveItem API This is a simplistic API that basically removes the icon from it's old location, and adds it to its new location. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 6ae3f0eb5..cbc098082 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -456,6 +456,17 @@ var BaseAppView = GObject.registerClass({ return [targetPage, targetPosition, dragLocation]; } + _moveItem(item, newPage, newPosition) { + const [page, position] = this._grid.getItemPosition(item); + if (page === newPage && position === newPosition) + return; + + if (page !== -1 && position !== -1) + this._removeItem(item); + + this._addItem(item, newPage, newPosition); + } + vfunc_allocate(box) { const width = box.get_width(); const height = box.get_height();